/***************************************************************
Copyright Statement:

This software/firmware and related documentation (EcoNet Software) 
are protected under relevant copyright laws. The information contained herein 
is confidential and proprietary to EcoNet (HK) Limited (EcoNet) and/or 
its licensors. Without the prior written permission of EcoNet and/or its licensors, 
any reproduction, modification, use or disclosure of EcoNet Software, and 
information contained herein, in whole or in part, shall be strictly prohibited.

EcoNet (HK) Limited  EcoNet. ALL RIGHTS RESERVED.

BY OPENING OR USING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY 
ACKNOWLEDGES AND AGREES THAT THE SOFTWARE/FIRMWARE AND ITS 
DOCUMENTATIONS (ECONET SOFTWARE) RECEIVED FROM ECONET 
AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON AN AS IS 
BASIS ONLY. ECONET EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, 
WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 
OR NON-INFRINGEMENT. NOR DOES ECONET PROVIDE ANY WARRANTY 
WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTIES WHICH 
MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE ECONET SOFTWARE. 
RECEIVER AGREES TO LOOK ONLY TO SUCH THIRD PARTIES FOR ANY AND ALL 
WARRANTY CLAIMS RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES 
THAT IT IS RECEIVERS SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD 
PARTY ALL PROPER LICENSES CONTAINED IN ECONET SOFTWARE.

ECONET SHALL NOT BE RESPONSIBLE FOR ANY ECONET SOFTWARE RELEASES 
MADE TO RECEIVERS SPECIFICATION OR CONFORMING TO A PARTICULAR 
STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND 
ECONET'S ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE ECONET 
SOFTWARE RELEASED HEREUNDER SHALL BE, AT ECONET'S SOLE OPTION, TO 
REVISE OR REPLACE THE ECONET SOFTWARE AT ISSUE OR REFUND ANY SOFTWARE 
LICENSE FEES OR SERVICE CHARGES PAID BY RECEIVER TO ECONET FOR SUCH 
ECONET SOFTWARE.
***************************************************************/
#ifndef _OMCI_ME_EXTERNAL_H_
#define _OMCI_ME_EXTERNAL_H_

#include "omci_lib_external.h"


/************************************************************************
*                  M A C R O S
*************************************************************************
*/



/************************************************************************
*                  D A T A     T Y P E S
*************************************************************************
*/
#ifndef GNU_PACKED
#define GNU_PACKED __attribute__ ((packed))
#endif//GNU_PACKED

typedef struct GNU_PACKED omci_me_info_s{
	uint16_t trans_rel_id;		//transaction correlation identifer
	uint8_t  msg_type;
	uint8_t	 dev_id;	//device id, 0x0A: baseline msg, 0x0b: extend msg
	uint16_t class_id;
	uint16_t inst_id;
	uint16_t mask;	//as input parameter: mask for set/get;  as output parameter: execute mask 
	uint16_t opt_mask; //optional mask for set/get message
	uint8_t *attributes;
	uint16_t attr_len;
}omci_me_info_t, *omci_me_info_ptr;

typedef struct GNU_PACKED omci_table_attr_s
{
    char* buf;
    int   len;
}omci_table_attr_t, *omci_table_attr_ptr;


/*9.1*/
/*******************************************************************************************************************************
9.1.1 ONU-G (Class ID 256)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_onu_g_s{
    uint16_t meId;
    char vendorId[4];
    char version[14];
    char serialNumber[8];
    uint8_t trafficMgrOp;
    uint8_t deprecated;
    uint8_t batteryBackup;
    uint8_t adminState;
    uint8_t operationalState;
    uint8_t onuSurvivalTime;
    char logicalOnuId[24];
    char logicalPassword[12];
    uint8_t credentialsStatus;
    uint16_t extendedTCLayerOp;
}omci_onu_g_t, *omci_onu_g_ptr;

/*******************************************************************************************************************************
9.1.2 ONU2-G (Class ID 257)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_onu2_g_s{
    uint16_t meId;
    char equipmentId[20];
    uint8_t omccVersion;
    uint16_t vendorProductCode;
    uint8_t securityCapability;
    uint8_t securityMode;
    uint16_t totalPriorityQueueNum;
    uint8_t totalTrafficSchedulerNum;
    uint8_t deprecated;
    uint16_t totalGemPortNum;
    uint32_t sysUpTime;
    uint16_t connectivityCapability;
    uint8_t currentConnectivityMode;
    uint16_t qosCfgFlexibility;
    uint16_t priorityQueueScaleFactor;
}omci_onu2_g_t, *omci_onu2_g_ptr;

/*******************************************************************************************************************************
9.1.3 ONU data (Class ID 2)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_onu_data_s{
    uint16_t meId;
    uint8_t mibDataSync;
}omci_onu_data_t, *omci_onu_data_ptr;

/*******************************************************************************************************************************
9.1.4 Software image(Class ID 7)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_software_image_s{
    uint16_t meId;
    char version[14];
    uint8_t isCommited;
    uint8_t isActive;
    uint8_t isValid;
    char productCode[25];
    char imageHash[16];
}omci_software_image_t, *omci_software_image_ptr;

/*******************************************************************************************************************************
9.1.5 cardholder (Class ID 5)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_cardholder_s{
    uint16_t meId;
    uint8_t actualPlugInUnitType;
    uint8_t expectedPlugInUnitType;
    uint8_t expectedPortCount;
    char expectedEquipmentId[20];
    char actualEquipmentId[20];
    uint8_t protectionProfilePointer;
    uint8_t invokeProtectionSwitch;
    uint8_t arc;
    uint8_t arcInterval;    
}omci_cardholder_t, *omci_cardholder_ptr;

/*******************************************************************************************************************************
9.1.6 Circuit pack (Class ID 6)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_circuit_pack_s{
    uint16_t meId;
    uint8_t type;
    uint8_t numberOfPort;
    char serialNumber[8];
    char version[14];
    char vendorId[4];
    uint8_t adminState;
    uint8_t operationalState;
    uint8_t bridgedOrIPind;
    char equipmentId[20];   
    uint8_t cardCfg;
    uint8_t totalTcontBuffNum;
    uint8_t totalPriorityQueueNum;
    uint8_t totalTrafficSchedulerNum;
    uint32_t powerShedOverride;
}omci_circuit_pack_t, *omci_circuit_pack_ptr;

/*******************************************************************************************************************************
9.1.7 ONU power shedding (Class ID 133)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_onu_power_shedding_s{
    uint16_t meId;
    uint16_t restorePowerTimerResetInterval;
    uint16_t dataClassSheddingInterval;
    uint16_t voiceClassSheddingInterval;
    uint16_t videoOverlayClassSheddingInterval;
    uint16_t videoReturnClassSheddingInterval;
    uint16_t dslClassSheddingInterval;
    uint16_t atmClassSheddingInterval;
    uint16_t cesClassSheddingInterval;
    uint16_t frameClassSheddingInterval;
    uint16_t sdhSonetClassSheddingInterval;
    uint16_t sheddingStatus;
}omci_onu_power_shedding_t, *omci_onu_power_shedding_ptr;

/*******************************************************************************************************************************
9.1.8 Port mapping package (Class ID 297)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_port_mapping_pkt_s{
    uint16_t meId;
	uint8_t	 maxPorts;
	char portList1[16];
	char portList2[16];
	char portList3[16];
	char portList4[16];
	char portList5[16];
	char portList6[16];
	char portList7[16];
	char portList8[16];
	omci_table_attr_t combinedPortTable;
}omci_port_mapping_pkt_t, *omci_port_mapping_pkt_ptr;

/*******************************************************************************************************************************
9.1.9 Equipment extension package (Class ID 160)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_equip_ext_pkt_s{
    uint16_t meId;
	uint16_t envSense;
	uint16_t contClosure;
}omci_equip_ext_pkt_t, *omci_equip_ext_pkt_ptr;


/*******************************************************************************************************************************
9.1.10 Protection Data (Class ID 279)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_prot_data_s{
    uint16_t meId;
	uint16_t workPtr;
	uint16_t protPtr;
	uint8_t protType;
	uint8_t revertInd;
	uint16_t waitRestTime;
	uint16_t switchGuardTime;
}omci_prot_data_t, *omci_prot_data_ptr;


/*******************************************************************************************************************************
9.1.11 Equipment Protection Profile (Class ID 159)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_equip_prot_prof_s{
    uint16_t meId;
	uint8_t protSlot[2];
	uint8_t workSlot[8];
	uint8_t protStatus[2];
	uint8_t revertInd;
	uint8_t waitRestTime;
}omci_equip_prot_prof_t, *omci_equip_prot_prof_ptr;

/*******************************************************************************************************************************
9.1.12 ONU remote debug(Class ID 158)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_onu_remote_debug_s{
    uint16_t meId;
    uint8_t commandFormat;
    char command[25];
    omci_table_attr_t replyTable;
}omci_onu_remote_debug_t, *omci_onu_remote_debug_ptr;

/*******************************************************************************************************************************
9.1.13 ONU-E(Class ID 331)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_onu_e_s{
    uint16_t meId;
    char vendId[4];
    char version[14];
    char sn[8];
}omci_onu_e_t, *omci_onu_e_ptr;

/*******************************************************************************************************************************
9.1.14 ONU Dynamic Power management control(Class ID 336)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_onu_dyn_pwr_manage_ctrl_s{
    uint16_t meId;
    uint8_t pwrReduction;
    uint8_t pwrReductionMode;
    uint16_t itransinit;
    uint16_t itxinit;
    uint32_t maxSleepIntvl;
    uint32_t minAwareIntvl;
    uint16_t minActHeldIntvl;
    uint64_t maxSleepIntvlExt;
}omci_onu_dyn_pwr_manage_ctrl_t, *omci_onu_dyn_pwr_manage_ctrl_ptr;

/*9.2*/
/*******************************************************************************************************************************
9.2.1 ANI-G (Class ID 263)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_ani_g_s{
    uint16_t meId;
    uint8_t srIndication;
    uint16_t totalTcontNum;
    uint16_t gemBlockLength;
    uint8_t piggybackDBAReport;
    uint8_t deprecated;
    uint8_t sfThreshold;
    uint8_t sdThreshold;
    uint8_t arc;
    uint8_t arcInterval;
    uint16_t opticalSignalLevel;
    uint8_t lowerOpticalThreshold;
    uint8_t upperOpticalThreshold;
    uint16_t onuResponseTime;
    uint16_t transmitOpticalLevel;
    uint8_t lowerTransmitPowerThreshold;
    uint8_t upperTransmitPowerThreshold;
}omci_ani_g_t, *omci_ani_g_ptr;

/*******************************************************************************************************************************
9.2.2 T-CONT (Class ID 262)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_t_cont_s{
    uint16_t meId;
    uint16_t allocId;
    uint8_t deprecated;
    uint8_t policy;
}omci_t_cont_t, *omci_t_cont_ptr;

/*******************************************************************************************************************************
9.2.3 GEM port network CTP (Class ID 268)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_gem_port_ctp_s
{
    uint16_t	meId;
    uint16_t	portId;
    uint16_t	tcontPointer;//0:un-inited;    0: variable length
    uint8_t		direction;//R, W, R/W.....
    uint16_t	TrafficManagePointerUp;//POINTTER;BIT_FIELD...
    uint16_t	TrafficDescriptorPointerUp;
    uint8_t		UNICounter;
    uint16_t	PriorityQueuePointerDown;
    uint8_t		encryptionState;// point to the code point table buffer
    uint16_t	TrafficDescriptorPointerDown;
    uint8_t		encryptionKeyRing;
}omci_gem_port_ctp_t, *omci_gem_port_ctp_ptr;

/*******************************************************************************************************************************
9.2.4 GEM interwork termination point (Class ID 266)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_gem_interwork_tp_s
{
    uint16_t	meId;
    uint16_t	gemPortNetCTPConPtr;
    uint8_t 	interworkOpt;
    uint16_t	serProfilePtr;
    uint16_t	interworkTPPtr;
    uint8_t 	PPTPCounter;
    uint8_t 	opState;
    uint16_t	GALProfilePtr;
    uint8_t 	GALLoopConfig;
}omci_gem_interwork_tp_t, *omci_gem_interwork_tp_ptr;

/*******************************************************************************************************************************
9.2.5 Multicast GEM interwork termination point (Class ID 281)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mc_gem_interwork_tp_s
{
	uint16_t	meId;
	uint16_t	gemPortNetCTPConPtr;
	uint8_t 	interworkOpt;
	uint16_t	serProfilePtr;
	uint16_t	notUsed1;
	uint8_t 	PPTPCounter;
	uint8_t 	opState;
	uint16_t	GALProfilePtr;
	uint8_t 	notUsed2;
	omci_table_attr_t  IPv4McAddrTbl;
	omci_table_attr_t  IPv6McAddrTbl;	
}omci_mc_gem_interwork_tp_t, *omci_mc_gem_interwork_tp_ptr;

/*******************************************************************************************************************************
9.2.6 GEM Port PM in G.984.4(Class ID 267)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_gem_port_pm_s
{
    uint16_t	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	lostPackets;
	uint32_t	misInsertPackets;
	uint8_t		receivedPackets[5];
	uint8_t		receivedBlocks[5];
	uint8_t		transBlocks[5];
	uint32_t	impairedBlocks;
}omci_gem_port_pm_t, *omci_gem_port_pm_ptr;
	
/*******************************************************************************************************************************
9.2.7 GAL Ethernet profile (Class ID 272)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_gal_eth_prof_s
{
	uint16_t	meId;
	uint16_t 	maxGemPayloadSize;
}omci_gal_eth_prof_t, *omci_gal_eth_prof_ptr;

/*******************************************************************************************************************************
9.2.8 GAL Ethernet performance monitoring history data (Class ID 276)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_gal_eth_pm_hist_s
{
	uint16_t	meId;
	uint8_t 	intervalEndTime;
	uint16_t	thdDataHalfId;
	uint32_t	discardFrames;
}omci_gal_eth_pm_hist_t, *omci_gal_eth_pm_hist_ptr;
	
/*******************************************************************************************************************************
9.2.9 FEC performance monitoring history data (Class ID 312)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_fec_pm_hist_s
{
	uint16_t	meId;
	uint8_t 	intervalEndTime;
	uint16_t	thdDataHalfId;
	uint32_t	correctedBytes;
	uint32_t	correctedCodeWords;	
	uint32_t	uncorrectedCodeWords;
	uint32_t	totalCodeWords;
	uint16_t	fecSeconds;
}omci_fec_pm_hist_t, *omci_fec_pm_hist_ptr;

/*******************************************************************************************************************************
9.2.10 Priority Queue (Class ID 277)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_priority_queue_s{
    uint16_t meId;
    uint8_t queueCfgOption;
    uint16_t maxQueueSize;
    uint16_t allocatedQueueSize;
    uint16_t discardBlockCounterResetInterval;
    uint16_t thdValForDiscardBlockBuffOverflow;
    uint32_t relatedPort;
    uint16_t trafficSchedulerPointer;
    uint8_t weight;
    uint16_t backPressureOperation;
    uint32_t backPressureTime;
    uint16_t backPressOccurQueueThd;
    uint16_t backPressClearQueueThd;
    uint8_t pktDropQueueThresholds[8]; //8bytes
    uint8_t pktDropMaxP[2];
    uint8_t queueDropWq;
    uint8_t dropPrecedenceColourMarking;
}omci_priority_queue_t, *omci_priority_queue_ptr;

/*******************************************************************************************************************************
9.2.11 Traffic  Scheduler (Class ID 278)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_traffic_scheduler_s{
    uint16_t meId;
    uint16_t tcontPointer;
    uint16_t trafficSchedulerPointer;
    uint8_t policy;
    uint8_t priorityOrWeight;
}omci_traffic_scheduler_t, *omci_traffic_scheduler_ptr;

/*******************************************************************************************************************************
9.2.12 Traffic Descriptor(Class ID 280)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_traffic_descriptor_s{
    uint16_t	meId;
    uint32_t	cir;
    uint32_t	pir;
    uint32_t	cbs;
    uint32_t	pbs;
    uint8_t		colourMode;
    uint8_t		ingressColourMode;
    uint8_t		egressColourMode;
    uint8_t		meterType;
}omci_traffic_descriptor_t, *omci_traffic_descriptor_ptr;

/*******************************************************************************************************************************
9.2.13 GEM port network CTP performance monitoring history data(Class ID 341)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_gemport_net_ctp_pm_his_s{
    uint16_t	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	transGemFrames;
	uint32_t	receivedGemFrames;
	uint64_t	receivedPayloadBytes;
	uint64_t	transPayloadBytes;
	uint32_t	encrypKeyErr;
}omci_gemport_net_ctp_pm_his_t, *omci_gemport_net_ctp_pm_his_ptr;

/*******************************************************************************************************************************
9.2.14 Energy consumption performance monitoring history data(Class ID 343)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_energy_consumption_pm_his_s{
    uint16_t	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	dozeTime;
	uint32_t	cyclicSleepTime;
	uint32_t	energyConsumed;
}omci_energy_consumption_pm_his_t, *omci_energy_consumption_pm_his_ptr;
/*******************************************************************************************************************************
9.2.15: XG-PON TC performance monitoring history data(Class ID 344)   2017 G988

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_xgon_tc_pm_hist_s
{
    uint16_t    meId;
    uint8_t     intervalEndTime;
    uint16_t    thdDataHalfId;
    uint32_t    PSBdHECErrCnt;
    uint32_t    XGTCHECErrCnt; 
    uint32_t    unkonowPrfCnt;
    uint32_t    transXGENFrame;
    uint32_t    fragmentXGEMFrame;
    uint32_t    XGEMHECLostWordCnt;
    uint32_t    XGEMKeyErr;
    uint32_t    XGEMHECErrCnt;
    uint64_t    transByteNonIdleXGEMFrame;
    uint64_t    rcvByteNonIdleXGEMFrame;
    uint32_t    LODSEventCnt;
    uint32_t    LODSEventRestoreCnt;
    uint32_t    OnuReactiveByLODS;
}omci_xgon_tc_pm_hist_t, *omci_xgon_tc_pm_hist_ptr;
/*******************************************************************************************************************************
9.2.16: XG-PON downstream management performance monitoring history data(Class ID 345)   2017 G988

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_xgon_ds_mgnt_pm_hist_s
{
    uint16_t    meId;
    uint8_t     intervalEndTime;
    uint16_t    thdDataId;
    uint32_t    PloamMicErrCnt;
    uint32_t    DsPloamMsgCnt; 
    uint32_t    ProfileMsgRx;
    uint32_t    RangeTimeMsgRx;
    uint32_t    DeactOnuIdMsgRx;
    uint32_t    DisableSnMsgRx;
    uint32_t    ReqRegMsgRx;
    uint32_t    AssignAllocIdMsgRx;
    uint32_t    KeyCtrlMsgRx;
    uint32_t    SleepAllowMsgRx;
    uint32_t    BaseOmciMsgRx;
    uint32_t    ExtOmciMsgRx;
    uint32_t    AssignOnuIdMsgRx;
    uint32_t    OmciMicErrCnt; 
}omci_xgon_ds_mgnt_pm_hist_t, *omci_xgon_ds_mgnt_pm_hist_ptr;
/*******************************************************************************************************************************
9.2.17: XG-PON upstream management performance monitoring history data(Class ID 346)   2017 G988

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_xgon_us_mgnt_pm_hist_s
{
    uint16_t    meId;
    uint8_t     intervalEndTime;
    uint16_t    thdDataId;
    uint32_t    UsPloamMsgCnt; 
    uint32_t    SnOnuMsgCnt;
    uint32_t    RegMsgCnt;
    uint32_t    KeyRptMsgCnt;
    uint32_t    AckMsgCnt;
    uint32_t    SleepReqMsgCnt;
}omci_xgon_us_mgnt_pm_hist_t, *omci_xgon_us_mgnt_pm_hist_ptr;
/*******************************************************************************************************************************
9.2.22: Enhanced FEC performance monitoring history data(Class ID 453)  2017 G988

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_enhanced_fec_pm_hist_s
{
    uint16_t    meId;
    uint8_t     intervalEndTime;
    uint16_t    thdDataHalfId;
    uint64_t    correctedBytes;
    uint64_t    correctedCodeWords; 
    uint64_t    uncorrectedCodeWords;
    uint64_t    totalCodeWords;
    uint16_t    fecSeconds;
}omci_enhanced_fec_pm_hist_t, *omci_enhanced_fec_pm_hist_ptr;

/*******************************************************************************************************************************
9.2.23: Enhanced TC performance monitoring history data(Class ID 454)  2017 G988

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_enhanced_tc_pm_hist_s
{
    uint16_t    meId;
    uint8_t     intervalEndTime;
    uint16_t    thdDataHalfId;
    uint32_t    PSBdHECErrCnt;
    uint32_t    XGTCHECErrCnt; 
    uint32_t    unkonowPrfCnt;
    uint64_t    transXGENFrame;
    uint64_t    fragmentXGEMFrame;
    uint64_t    XGEMHECLostWordCnt;
    uint64_t    XGEMKeyErr;
    uint64_t    XGEMHECErrCnt;
    uint64_t    transByteNonIdleXGEMFrame;
    uint64_t    rcvByteNonIdleXGEMFrame;
    uint32_t    LODSEventCnt;
    uint32_t    LODSEventRestoreCnt;
    uint32_t    OnuReactiveByLODS;
}omci_enhanced_tc_pm_hist_t, *omci_enhanced_tc_pm_hist_ptr;

/*9.3*/
/*******************************************************************************************************************************
9.3.1 MAC Bridge Service Profile ME(Class ID 45)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_service_s
{
	uint16_t	meId;
	uint8_t		spanTreeInd;
	uint8_t		learnInd;
	uint8_t		portBrInd;
	uint16_t	priority;
	uint16_t	maxAge;
	uint16_t	helloTime;
	uint16_t	forwordDelay;
	uint8_t		unkMACAddrDis;
	uint8_t		MACLearnDepth;
	uint32_t	dynFilterAgeTime;
}omci_mac_br_service_t, *omci_mac_br_service_ptr;

/*******************************************************************************************************************************
9.3.2 MAC Bridge Configuration Data ME(Class ID 46)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_cfg_data_s
{
	uint16_t	meId;
	char		brMACAddr[6];
	uint16_t	brPriority;
	char		designatedRoot[8];
	uint32_t	rootPathCost;
	uint8_t		brPortCnt;
	uint16_t	rootPortNum;
	uint16_t	helloTime;
	uint16_t	forwordDelay;
}omci_mac_br_cfg_data_t, *omci_mac_br_cfg_data_ptr;

/*******************************************************************************************************************************
9.3.3 MAC bridge performance monitoring history data ME(Class ID 51)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_pm_his_s
{
    uint16_t	meId;
	uint8_t		interEndTime;
    uint16_t	threshDataId;
	uint32_t	brLearnEntryDisCnt;
}omci_mac_br_pm_his_t, *omci_mac_br_pm_his_ptr;

/*******************************************************************************************************************************
9.3.4 MAC bridge port configuration data (Class ID 47)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_port_cfg_s
{
    uint16_t	meId;
    uint16_t	bridgeIDPointer;
	uint8_t		portNum;
	uint8_t		tpType;
    uint16_t	tpPointer;
    uint16_t	portPriority;
    uint16_t	portPathCost;
	uint8_t		portSpanningTreeInd;
	uint8_t		deprecated1;
	uint8_t		deprecated2;
    uint8_t		portMacAddr[6];
    uint16_t	outboundTDPointer;
    uint16_t	inboundTDPointer;
	uint8_t		macLearnDepth;
}omci_mac_br_port_cfg_t, *omci_mac_br_port_cfg_ptr;

/*******************************************************************************************************************************
9.3.5 MAC bridge port designation data(Class ID 48)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_port_dest_s
{
	uint16_t	meId;
	char		destBrRootCostPort[24];
	uint8_t		portState;
}omci_mac_br_port_dest_t, *omci_mac_br_port_dest_ptr;

/*******************************************************************************************************************************
9.3.6 mac bridge port filter table (Class ID 49)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_port_filter_s
{
	uint16_t	meId;
    omci_table_attr_t macFilterOp;
}omci_mac_br_port_filter_t, *omci_mac_br_port_filter_ptr;

/*******************************************************************************************************************************
9.3.7 mac bridge port filter preassign table (Class ID 79)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_port_filter_pre_s
{
	uint16_t	meId;
	uint8_t		ipv4MultiFilter;
	uint8_t		ipv6MultiFilter;
	uint8_t		ipv4BroadFilter;
	uint8_t		rarpFilter;
	uint8_t		ipxFilter;
	uint8_t		netBeuiFilter;
	uint8_t		appleTalkFilter;
	uint8_t		brMngInfoFilter;
	uint8_t		arpFilter;
	uint8_t		pppoeBroadFilter;
}omci_mac_br_port_filter_pre_t, *omci_mac_br_port_filter_pre_ptr;

/*******************************************************************************************************************************
9.3.8 mac bridge port bridge table data(Class ID 50)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_port_br_tbl_s
{
	uint16_t	meId;
    omci_table_attr_t brTable;
}omci_mac_br_port_br_tbl_t, *omci_mac_br_port_br_tbl_ptr;

/*******************************************************************************************************************************
9.3.9 mac bridge port performance monitoring history data(Class ID 52)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_port_pm_his_s
{
	uint16_t	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	forwardFrameCnt;
	uint32_t	delayExceedDisCnt;
	uint32_t	mtuExceedDisCnt;
	uint32_t	receiveFrameCnt;
	uint32_t	receiveDisCnt;
}omci_mac_br_port_pm_his_t, *omci_mac_br_port_pm_his_ptr;

/*******************************************************************************************************************************
9.3.10 IEEE 802.1p mapper service profile(Class ID 130)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_802_1p_map_service_s
{
    uint16_t	meId;
    uint16_t	tpPointer;
    uint16_t	tpPointerP[8];
	uint8_t		unmarkFrameOpt;
    uint8_t		DSCP2PbitMap[24];
	uint8_t		defaultPbitAssumption;
	uint8_t		tpType;
}omci_802_1p_map_service_t, *omci_802_1p_map_service_ptr;

/*******************************************************************************************************************************
9.3.11 vlan tagging filter data(Class ID 84)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_vlan_filter_s
{
    uint16_t	meId;
    uint8_t		VLANFilterList[24];
	uint8_t		forwordOp;
	uint8_t		entryNum;
}omci_vlan_filter_t, *omci_vlan_filter_ptr;

/*******************************************************************************************************************************
9.3.12 vlan tagging operation configuration data(Class ID 78)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_vlan_tag_op_cfg_s
{
    uint16_t	meId;
    uint8_t		upVLANTagOpMode;
	uint16_t	upVLANTagTCIVal;
    uint8_t		downVLANTagOpMode;
    uint8_t		associationType;
    uint16_t	associatedMePointer;
}omci_vlan_tag_op_cfg_t, *omci_vlan_tag_op_cfg_ptr;

/*******************************************************************************************************************************
9.3.13 extended vlan tagging operation configuration data (Class ID 171)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_vlan_tag_ext_op_s
{
    uint16_t	meId;
    uint8_t		associationType;
    uint16_t	vlanTableMaxSize;//0:un-inited;    0: variable length
    uint16_t	inputTpid;//R, W, R/W.....
    uint16_t	outputTpid;//POINTTER;BIT_FIELD...
    uint8_t		downstreamMode;
    omci_table_attr_t vlanTaggingOp;
    uint16_t	associatedMePointer;
    uint8_t		dscpToPbitMapping[24];
}omci_vlan_tag_ext_op_t, *omci_vlan_tag_ext_op_ptr;

/*******************************************************************************************************************************
9.3.18 Dot1 rate limiter(Class ID 298)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_dot1_rate_limit_s
{
    uint16_t	meId;
    uint16_t	parentMePointer;
    uint8_t		tpType;
    uint16_t	upUnicastFloodRatePointer;
    uint16_t	upBroadcastRatePointer;
    uint16_t	upMulticastPayloadRatePointer;
}omci_dot1_rate_limit_t, *omci_dot1_rate_limit_ptr;

/*******************************************************************************************************************************
9.3.19 Dot1ag maintenance domain(Class ID 299)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_dot1ag_maint_domain_s
{
    uint16_t	meId;
    uint8_t		mdLevel;
    uint8_t		mdNameFormat;
	char		mdName1[25];
	char		mdName2[25];
    uint8_t		mhfCreation;
    uint8_t		senderIdPermission;
}omci_dot1ag_maint_domain_t, *omci_dot1ag_maint_domain_ptr;

/*******************************************************************************************************************************
9.3.20 Dot1ag maintenance association(Class ID 300)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_dot1ag_maint_associat_s
{
    uint16_t	meId;
    uint16_t	mdPointer;
    uint8_t		shortMaNameFormat;
	char		shortMaName1[25];
	char		shortMaName2[25];
    uint8_t		ccmInterval;
	char		associateVlans[24];
    uint8_t		mhfCreation;
    uint8_t		senderIdPermission;
}omci_dot1ag_maint_associat_t, *omci_dot1ag_maint_associat_ptr;

/*******************************************************************************************************************************
9.3.27 multicast operations profile(Class ID 309)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_multicast_op_profile_s
{
    uint16_t	meId;
    uint8_t		igmpVer;	
    uint8_t		igmpFunc;
    uint8_t		immediateLeave;
    uint16_t	upIgmpTci;
    uint8_t		upIgmpTagCtrl;
	uint32_t	upIgmpRate;
    omci_table_attr_t dynAccessCtrlListTable;
    omci_table_attr_t staticAccessCtrlListTable;
    omci_table_attr_t lostGroupListTable;
    uint8_t		robustness;
	char		querierIpAddr[4];
	uint32_t	queryInterval;
	uint32_t	queryMaxRespTime;
	uint32_t	lastMemberQueryInterval;
    uint8_t		unAuthJoinReqBehaviour;
	char		downIgmpMultiTci[3];
}omci_multicast_op_profile_t, *omci_multicast_op_profile_ptr;

/*******************************************************************************************************************************
9.3.28 multicast subscriber config info(Class ID 310)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_multicast_subs_cfg_info_s
{
    uint16_t	meId;
    uint8_t		meType;
    uint16_t	multiOpProPointer;
    uint16_t	maxSimuGroups;
	uint32_t	maxMultiBw;
    uint8_t		bwEnforement;
    omci_table_attr_t multiSrvPackTable;
    omci_table_attr_t allowPreGroupTable;	
}omci_multicast_subs_cfg_info_t, *omci_multicast_subs_cfg_info_ptr;

/*******************************************************************************************************************************
9.3.29 multicast subscriber monitor(Class ID 311)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_multicast_subs_monitor_s
{
    uint16_t	meId;
    uint8_t		meType;
	uint32_t	curMultiBw;
	uint32_t	joinMsgCnt;
	uint32_t	bwExceedCnt;
    omci_table_attr_t ipv4ActGroupListTable;
    omci_table_attr_t ipv6ActGroupListTable;	
}omci_multicast_subs_monitor_t, *omci_multicast_subs_monitor_ptr;

/*******************************************************************************************************************************
9.3.30 ethernet frame performance monitoring history data upstream(Class ID 322)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_eth_frame_pm_his_up_s
{
	uint16_t	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	dropEvent;
	uint32_t	octets;
	uint32_t	packets;
	uint32_t	broadPackets;
	uint32_t	multiPackets;
	uint32_t	crcErrPackets;
	uint32_t	underPackets;
	uint32_t	overPackets;
	uint32_t	packets64;
	uint32_t	packets65to127;
	uint32_t	packets128to255;
	uint32_t	packets256to511;
	uint32_t	packets512to1023;
	uint32_t	packets1024to1518;
}omci_eth_frame_pm_his_up_t, *omci_eth_frame_pm_his_up_ptr;

/*******************************************************************************************************************************
9.3.31 ethernet frame performance monitoring history data downstream(Class ID 321)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_port_pm_his_down_s
{
	uint16_t	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	dropEvent;
	uint32_t	octets;
	uint32_t	packets;
	uint32_t	broadPackets;
	uint32_t	multiPackets;
	uint32_t	crcErrPackets;
	uint32_t	underPackets;
	uint32_t	overPackets;
	uint32_t	packets64;
	uint32_t	packets65to127;
	uint32_t	packets128to255;
	uint32_t	packets256to511;
	uint32_t	packets512to1023;
	uint32_t	packets1024to1518;
}omci_eth_frame_pm_his_down_t, *omci_mac_br_port_pm_his_down_ptr;

/*******************************************************************************************************************************
9.3.32 Ethernet frame extended PM(Class ID 334)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_eth_frame_ext_pm_s
{
	uint16_t	meId;
    uint8_t		interEndTime;
    char		ctrlBlock[16];
	uint32_t	dropEvent;
	uint32_t	octets;
	uint32_t	frames;
	uint32_t	broadFrames;
	uint32_t	multiFrames;
	uint32_t	crcErrFrames;
	uint32_t	underFrames;
	uint32_t	overFrames;
	uint32_t	frames64;
	uint32_t	frames65to127;
	uint32_t	frames128to255;
	uint32_t	frames256to511;
	uint32_t	frames512to1023;
	uint32_t	frames1024to1518;
}omci_eth_frame_ext_pm_t, *omci_eth_frame_ext_pm_ptr;

/*******************************************************************************************************************************
9.3.33 MAC bridge port ICMPv6 process preassign table(Class ID 348)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mac_br_port_icmpv6_proc_pre_tbl_s
{
	uint16_t	meId;
    uint8_t		icmpv6ErrMsgProcess;
    uint8_t		icmpv6InfoMsgProcess;
    uint8_t		routerSolicitProcess;
    uint8_t		routerAdvertiseProcess;
    uint8_t		neighbourSolicitProcess;
    uint8_t		neighbourAdvertiseProcess;
    uint8_t		redirectProcess;
    uint8_t		multiListenQueryProcess;
    uint8_t		unknownIcmpv6Process;
}omci_mac_br_port_icmpv6_proc_pre_tbl_t, *omci_mac_br_port_icmpv6_proc_pre_tbl_ptr;

/*******************************************************************************************************************************
9.3.34 Ethernet frame extended pm 64-bit(G.988 201405 Amendment Class ID 425)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_eth_frame_ext_pm_64bit_s
{
	uint16_t	meId;
    uint8_t		interEndTime;
    char		ctrlBlock[16];
	uint64_t	dropEvent;
	uint64_t	octets;
	uint64_t	frames;
	uint64_t	broadFrames;
	uint64_t	multiFrames;
	uint64_t	crcErrFrames;
	uint64_t	underFrames;
	uint64_t	overFrames;
	uint64_t	frames64;
	uint64_t	frames65to127;
	uint64_t	frames128to255;
	uint64_t	frames256to511;
	uint64_t	frames512to1023;
	uint64_t	frames1024to1518;
}omci_eth_frame_ext_pm_64bit_t, *omci_eth_frame_ext_pm_64bit_ptr;


/*9.4*/
/*******************************************************************************************************************************
9.4.1 ip host config (Class ID 134)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_ip_host_cfg_s{
    uint16_t meId;
    uint8_t ipOptions;
    uint8_t macAddr[6];
    char OnuIdentifier[25];
    uint32_t ipAddress;
    uint32_t mask;
    uint32_t gateway;
    uint32_t primaryDNS;
    uint32_t secondaryDNS;
    uint32_t currentAddress;
    uint32_t currentMask;
    uint32_t currentGateway;
    uint32_t currentPrimaryDNS;
    uint32_t currentSecondaryDNS;
    char domainName[25];
    char hostName[25];
    uint16_t relayAgentOption;
}omci_ip_host_cfg_t, *omci_ip_host_cfg_ptr;

/*******************************************************************************************************************************
9.4.2: IP host performance monitoring history data(Class ID 135)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_ip_host_pm_his_s{
    uint16_t meId;
    uint8_t interEndTime;
    uint16_t threshDataId;
    uint32_t icmpErr;
    uint32_t dnsErr;
    uint16_t dhcpTimeouts;
    uint16_t ipAddrConfict;
    uint16_t outOfMem;
    uint16_t internalErr;
}omci_ip_host_pm_his_t, *omci_ip_host_pm_his_ptr;

/*******************************************************************************************************************************
9.4.3: TCP/UDP config data(Class ID 136)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_tcp_udp_cfg_s{
    uint16_t meId;
    uint16_t portId;
    uint8_t protocol;
    uint8_t tosDiffField;
    uint16_t ipHostPointer;
}omci_tcp_udp_cfg_t, *omci_tcp_udp_cfg_ptr;

/*******************************************************************************************************************************
9.4.4: TCP/UDP performance monitoring history data(Class ID 342)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_tcp_udp_pm_his_s{
    uint16_t meId;
    uint8_t interEndTime;
    uint16_t threshDataId;
    uint16_t socketFailed;
    uint16_t listenFailed;
    uint16_t bindFailed;
    uint16_t acceptFailed;
    uint16_t selectFailed;
}omci_tcp_udp_pm_his_t, *omci_tcp_udp_pm_his_ptr;

/*******************************************************************************************************************************
PPPoE Wan config info (Class ID 250)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_PPPoE_wan_info_s{
    uint16_t meId;
    uint8_t  natMode;
    uint8_t  authValue;
    uint8_t  connectMode;
    uint16_t releaseTime;
    char userName[25];
    char password[25];
    uint16_t iphostTPPoint;
    uint16_t userNamePoint;
    uint16_t serviceNamePoint;
}omci_PPPoE_wan_info_t, *omci_PPPoE_wan_info_ptr;


/*9.5*/
/*******************************************************************************************************************************
9.5.1 physical path termination point ehternet UNI (Class ID 11)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_pptp_eth_uni_s{
    uint16_t meId;
    uint8_t expectedType;
    uint8_t sensedType;
    uint8_t autoDetectionCfg;
    uint8_t ethernetLoopbackCfg;
    uint8_t adminState;
    uint8_t operationalState;
    uint8_t cfgInd;
    uint16_t maxFrameSize;
    uint8_t DTEOrDCEInd;
    uint16_t pauseTime;
    uint8_t bridgeOrIpInd;
    uint8_t arc;
    uint8_t arcInterval;
    uint8_t pppoeFilter;
    uint8_t powerControl;
}omci_pptp_eth_uni_t, *omci_pptp_eth_uni_ptr;

/*******************************************************************************************************************************
9.5.2 Ethernet performance monitoring history data(Class ID 24)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_eth_pm_his_s{
    uint16_t 	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	fcsErr;
	uint32_t	excesCollisCnt;
	uint32_t	lateCollisCnt;
	uint32_t	frameTooLong;
	uint32_t	bufOverOnReceive;
	uint32_t	bufOverOnTrans;
	uint32_t	singleCollisFrameCnt;
	uint32_t	multiCollisFrameCnt;
	uint32_t	sqeCnt;
	uint32_t	deferTransCnt;
	uint32_t	interMACTransErrCnt;
	uint32_t	carrSenseErrCnt;
	uint32_t	alignErrCnt;
	uint32_t	interMACRcvErrCnt;
}omci_eth_pm_his_t, *omci_eth_pm_his_ptr;

/*******************************************************************************************************************************
9.5.3 Ethernet performance monitoring history data 2(Class ID 89)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_eth_pm_his_2_s{
    uint16_t 	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	pppoeFilterFrameCnt;
}omci_eth_pm_his_2_t, *omci_eth_pm_his_2_ptr;

/*******************************************************************************************************************************
9.5.4 Ethernet performance monitoring history data 3(Class ID 296)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_eth_pm_his_3_s{
    uint16_t 	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint32_t	dropEvent;
	uint32_t	octets;
	uint32_t	packets;
	uint32_t	broadPackets;
	uint32_t	multiPackets;
	uint32_t	underPackets;
	uint32_t	fragments;
	uint32_t	jabbers;
	uint32_t	packets64;
	uint32_t	packets65to127;
	uint32_t	packets128to255;
	uint32_t	packets256to511;
	uint32_t	packets512to1023;
	uint32_t	packets1024to1518;
}omci_eth_pm_his_3_t, *omci_eth_pm_his_3_ptr;

/*******************************************************************************************************************************
9.5.6 Ethernet performance monitoring history data 4(Class ID 255)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_eth_pm_his_4_s{
    uint16_t 	meId;
    uint8_t		interEndTime;
	uint16_t	threshDataId;
	uint8_t	    AssociationType;
	uint32_t	transmitted_traffic;
	uint32_t	received_traffic;
	uint32_t	transmitted_rate;
	uint32_t	received_rate;
	uint32_t	transmitted_Octets;
	uint32_t	received_Octets;
	uint32_t	transmitted_dis_cout;
	uint32_t	received_dis_cout;
	uint32_t	transmitted_err_cout;
	uint32_t	received_err_cout;
}omci_eth_pm_his_4_t, *omci_eth_pm_his_4_ptr;
/*******************************************************************************************************************************
9.5.5  virtual ethernet interface point (Class ID 329)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_veip_s{
    uint16_t meId;
    uint8_t adminState;
    uint8_t operationalState;
    char interdomainName[25];
    uint16_t tcpUdpPointer;
    uint16_t ianaAssignedPort;
}omci_veip_t, *omci_veip_ptr;


/*9.9*/
/*******************************************************************************************************************************
9.9.1 physical path termination point POTS UNI (Class ID 53)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_pptp_pots_uni_s{
    uint16_t meId;
    uint8_t adminState;
    uint16_t deprecated;
    uint8_t arc;
    uint8_t arcInterval;
    uint8_t impedance;
    uint8_t transmissionPath;
    uint8_t rxGain;
    uint8_t txGain;
    uint8_t operationalState;
    uint8_t hookState;
    uint16_t potsHoldoverTime;
    uint8_t nominalFeedVoltage;
    uint8_t lossOfSoftswitch;
}omci_pptp_pots_uni_t, *omci_pptp_pots_uni_ptr;

/*******************************************************************************************************************************
9.9.2 SIP user data (Class ID 153)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_sip_user_data_s{
	uint16_t meId;
	uint16_t sipAgentPtr;
	uint16_t userPartAOR;
	char	 sipDisplayName[25];
	uint16_t userNameOrPwd;
	uint16_t voiceMailServerSipUri;
	uint32_t voiceMailSubsExpTime;
	uint16_t netDialPlanPtr;
	uint16_t appSrvProfPtr;
	uint16_t featureCodePtr;
	uint16_t pptpPtr;
	uint8_t  releaseTimer;
	uint8_t  rohTimer;
}omci_sip_user_data_t, *omci_sip_user_data_ptr;

/*******************************************************************************************************************************
9.9.3 SIP agent config data (Class ID 150)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_sip_agent_cfg_s{
    uint16_t meId;
    uint16_t proxySrvAddrPtr;
    uint16_t outbndProxyAddrPtr;
    uint32_t primarySipDns;
    uint32_t secondarySipDns;
    uint16_t tcpOrUdpPtr;
    uint32_t sipRegExpTime;
    uint32_t sipReregHeadStartTime;
    uint16_t hostPartUri;
    uint8_t  sipStatus;
    uint16_t sipRegistrar;
    char softswitch[4];
	omci_table_attr_t  sipRespTab;
    uint8_t  sipOptTransCtrl;
    uint8_t  sipUrlFormat;
    uint16_t RedundSipAgentPtr;
}omci_sip_agent_cfg_t, *omci_sip_agent_cfg_ptr;

/*******************************************************************************************************************************
9.9.4  VoIP voice CTP (Class ID 139)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_voip_voice_ctp_s{
    uint16_t meId;
    uint16_t userProtoclPtr;
    uint16_t pptpPtr;
    uint16_t voipMediaProfPtr;
    uint8_t  sinallingCode;
}omci_voip_voice_ctp_t, *omci_voip_voice_ctp_ptr;

/*******************************************************************************************************************************
9.9.5  VoIP media  profile (Class ID 142)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_voip_media_prof_s{
	uint16_t meId;
	uint8_t  faxMode;
	uint16_t voiceSrvProfPtr;
	uint8_t  codecSelection1;
	uint8_t  pktPeriodSelection1;
	uint8_t  silenceSuppression1;
	uint8_t  codecSelection2;
	uint8_t  pktPeriodSelection2;
	uint8_t  silenceSuppression2;
	uint8_t  codecSelection3;
	uint8_t  pktPeriodSelection3;
	uint8_t  silenceSuppression3;
	uint8_t  codecSelection4;
	uint8_t  pktPeriodSelection4;
	uint8_t  silenceSuppression4;
	uint8_t  oobDtmf;
	uint16_t rtpProfPtr;
}omci_voip_media_prof_t, *omci_voip_media_prof_ptr;

/*******************************************************************************************************************************
9.9.6  VoIP service  profile (Class ID 58)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_voice_srv_prof_s{
	uint16_t meId;
	uint8_t  annouceType;
	uint16_t jitterTarget;
	uint16_t jitterBufMax;
	uint8_t  echoCancelInd;
	uint16_t pstnProtocolVariant;
	uint16_t dtmfDigitLevels;
	uint16_t dtmfDigitDuration;
	uint16_t hookFlashMinTime;
	uint16_t hookFlashMaxTime;
	omci_table_attr_t  tonePatternTab;
	omci_table_attr_t  toneEventTab;
	omci_table_attr_t  ringingPatternTab;
	omci_table_attr_t  ringingEventTab;
	uint16_t netSpecExtPtr;
}omci_voice_srv_prof_t, *omci_voice_srv_prof_ptr;

/*******************************************************************************************************************************
9.9.7  RTP profile data (Class ID 143)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_rtp_prof_s{
	uint16_t meId;
	uint16_t localPortMin;
	uint16_t localPortMax;
	uint8_t  dscpMark;
	uint8_t  piggybackEvent;
	uint8_t  toneEvents;
	uint8_t  dtmfEvents;
	uint8_t  casEvents;
	uint16_t iphostConfigPtr;
}omci_rtp_prof_t, *omci_rtp_prof_ptr;

/*******************************************************************************************************************************
9.9.8  VoIP application service profile (Class ID 146)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_voip_app_srv_prof_s{
	uint16_t meId;
	uint8_t  cidFeatures;
	uint8_t  callWaitingFeatures;
	uint16_t callProgOrTransFeatures;
	uint16_t callPresfeatures;
	uint8_t  directConnFeature;
	uint16_t directConnUriPtr;
	uint16_t brgLineAgentUriPtr;
	uint16_t coferFacUriPtr;
	uint16_t dialToneFeatDelayTimer;
}omci_voip_app_srv_prof_t, *omci_voip_app_srv_prof_ptr;

/*******************************************************************************************************************************
9.9.10  Network dial plan table  (Class ID 145)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_net_dial_plan_tab_s{
	uint16_t meId;
	uint16_t dialPlanNum;
	uint16_t dialPlanTabMaxSize;
	uint16_t criticalDialTimeout;
	uint16_t partialDialTimeout;
	uint8_t dialPlanFormat;
	omci_table_attr_t  dialPlanTab;
}omci_net_dial_plan_tab_t, *omci_net_dial_plan_tab_ptr;	

/*******************************************************************************************************************************
9.9.11 VoIP line status (Class ID 141)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_voip_line_status_s{
    uint16_t meId;
    uint16_t voipCodecUsed;
    uint8_t voipVoiceSrvStatus;
    uint8_t voipPortSessionType;
    uint16_t voipCall1PktPeriod;
    uint16_t voipCall2PktPeriod;
    char voipCall1DestAddr[25];
    char voipCall2DestAddr[25];
    uint8_t voipLineState;
    uint8_t emergencyCallStatus;
}omci_voip_line_status_t, *omci_voip_line_status_ptr;

/*******************************************************************************************************************************
9.9.12  Call Control performance monitoring history data (Class ID 140)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_call_ctl_pm_hist_s{
	uint16_t meId;
	uint8_t  intervalEndTime;
	uint16_t thdDataHalfId;
	uint32_t callSetupFail;
	uint32_t callSetupTimer;
	uint32_t callTerminateFail;
	uint32_t analogPortReleases;
	uint32_t analogPortOffhookTimer;
}omci_call_ctl_pm_hist_t, *omci_call_ctl_pm_hist_ptr;
	
/*******************************************************************************************************************************
9.9.13: Rtp performance monitoring history data(Class ID 144)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_rtp_pm_hist_s{
	uint16_t meId;
	uint8_t  intervalEndTime;
	uint16_t thdDataHalfId;
	uint32_t rtpErrors;
	uint32_t pktLoss;
	uint32_t maxJitter;
	uint32_t maxTimerBwtRtcpPkts;
	uint32_t bufUnderflows;
	uint32_t bufOverflows;
}omci_rtp_pm_hist_t, *omci_rtp_pm_hist_ptr;
		
/*******************************************************************************************************************************
9.9.14: SIP agent performance monitoring history data(Class ID 151)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_sip_agent_pm_hist_s{
	uint16_t meId;
	uint8_t  intervalEndTime;
	uint16_t thdDataHalfId;
	uint32_t transactions;
	uint32_t rxInviteReqs;
	uint32_t rxInviteRetrans;
	uint32_t rxNoninviteReqs;
	uint32_t rxNoninviteRetrans;
	uint32_t rxReponse;
	uint32_t rxReponseRetrans;
	uint32_t txInviteReqs;
	uint32_t txInviteRetrans;
	uint32_t txNoninviteReqs;
	uint32_t txNoninviteRetrans;
	uint32_t txReponse;
	uint32_t txReponseRetrans;	
}omci_sip_agent_pm_hist_t, *omci_sip_agent_pm_hist_ptr;

/*******************************************************************************************************************************
9.9.15: SIP call initation performance monitoring history data (Class ID 152)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_sip_call_init_pm_hist_s{
	uint16_t meId;
	uint8_t  intervalEndTime;
	uint16_t thdDataHalfId;
	uint32_t failedToConnectCnt;
	uint32_t failedToValidateCnt;
	uint32_t timeoutCnt;
	uint32_t failureRxCnt;
	uint32_t failureToAuthenCnt;	
}omci_sip_call_init_pm_hist_t, *omci_sip_call_init_pm_hist_ptr;
	
/*******************************************************************************************************************************
9.9.16: MGC config data (Class ID 155)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_mgc_cfg_data_s{
	uint16_t meId;
	uint16_t primaryMgc;
	uint16_t secondaryMgc;
	uint16_t tcpOrUdpPtr;
	uint8_t  version;
	uint8_t  msgFormate;
	uint16_t maxRetryTime;
	uint16_t maxRetryAttempts;
	uint16_t srvChangeDelay;
	char     terminationIdbase[25];	
	uint32_t softswitch;
	uint16_t msgIdPtr;	
}omci_mgc_cfg_data_t, *omci_mgc_cfg_data_ptr;

/*******************************************************************************************************************************
9.9.18 VoIP config data (Class ID 138)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_voip_cfg_data_s{
    uint16_t meId;
    uint8_t  availableSignalProtocols;
    uint8_t  signalProtocolUsed;
    uint32_t availableVoipCfgMethod;
    uint8_t  voipCfgMethodUsed;
    uint16_t voipCfgAddressPointer;
    uint8_t  voipCfgState;
    uint8_t  retrieveProfile;
    char     profileVersion[25];    
}omci_voip_cfg_data_t, *omci_voip_cfg_data_ptr;


/*9.12*/
/*******************************************************************************************************************************
9.12.1 UNI-G (Class ID 264)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_uni_g_s{
    uint16_t meId;
    uint16_t deprecated;
    uint8_t adminState;
    uint8_t managementCapability;
    uint16_t nonOMCIManagementIdentifier;
    uint16_t relayAgentOption;
}omci_uni_g_t, *omci_uni_g_ptr;

/*******************************************************************************************************************************
9.12.2 OLT-G (Class ID 131)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_olt_g_s{
    uint16_t meId;
    char oltVendorId[4];
    char equipmentId[20];
    char version[14];
    char timeOfDayInformation[14];
}omci_olt_g_t, *omci_olt_g_ptr;

/*******************************************************************************************************************************
9.12.3  network Address (Class ID 137)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_network_address_s{
    uint16_t meId;
    uint16_t securityPointer;
    uint16_t addressPointer;
}omci_network_address_t, *omci_network_address_ptr;

/*******************************************************************************************************************************
9.12.4 authentication security method (Class ID 148)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_auth_security_method_s{
    uint16_t meId;
    uint8_t validScheme;
    char username1[25];
    char password[25];
    char realm[25];
    char username2[25];
}omci_auth_security_method_t, *omci_auth_security_method_ptr;

/*******************************************************************************************************************************
9.12.5 Large String (Class ID 157)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_large_string_s{
    uint16_t meId;
    uint8_t numberOfParts;
    union{
        char part_split[15][25]; /*attribute part 1~15*/
        char part[15*25];
    }GNU_PACKED all_part;
}omci_large_string_t, *omci_large_string_ptr;

/*******************************************************************************************************************************
9.12.6 threshold data 1 (Class ID 273)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_threshold_data_1_s{
    uint16_t meId;
    uint32_t thresholdValue[7];
}omci_threshold_data_1_t, *omci_threshold_data_1_ptr;

/*******************************************************************************************************************************
9.12.7 threshold data 2 (Class ID 274)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_threshold_data_2_s{
    uint16_t meId;
    uint32_t thresholdValue[7];
}omci_threshold_data_2_t, *omci_threshold_data_2_ptr;

/*******************************************************************************************************************************
9.12.8 OMCI (Class ID 287)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_omci_s{
    uint16_t meId;
    omci_table_attr_t meTypeTable;
    omci_table_attr_t messageTypeTable;
}omci_omci_t, *omci_omci_ptr;

/*******************************************************************************************************************************
9.12.9 managed entity (Class ID 288)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_managed_entity_s{
    uint16_t meId;
    char name[25];
    omci_table_attr_t attributeTable;
    uint8_t access;
    omci_table_attr_t alarmsTable;
    omci_table_attr_t avcsTable;
    uint32_t action;
    omci_table_attr_t instanceTable;
    uint8_t support;
}omci_managed_entity_t, *omci_managed_entity_ptr;

/*******************************************************************************************************************************
9.12.10 Attribute (Class ID 289)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_attribute_s{
    uint16_t meId;
    char name[25];
    uint16_t size;
    uint8_t access;
    uint8_t format;
    uint32_t lowerLimit;
    uint32_t upperLimit;
    uint32_t bitField;
    omci_table_attr_t codePointerTable;
    uint8_t support;
}omci_attribute_t, *omci_attribute_ptr;

/*******************************************************************************************************************************
9.12.11 Octec string (Class ID 307)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_octet_string_s{
    uint16_t meId;
    uint16_t length;
    union{
        char part_split[15][25]; /*attribute part 1~15*/
        char part[15*25];
    }GNU_PACKED all_part;
}omci_octet_string_t, *omci_octet_string_ptr;

/*******************************************************************************************************************************
9.12.12 General purpose buffer (Class ID 308)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_general_purpose_buf_s{
    uint16_t meId;
    uint32_t maxSize;
    omci_table_attr_t bufTable;
}omci_general_purpose_buf_t, *omci_general_purpose_buf_ptr;

/*******************************************************************************************************************************
9.12.13 file transfer controller(Class ID 318)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_file_transfer_ctrl_s{
    uint16_t meId;
    uint16_t supportedTransferProtocols;
    uint16_t fileType;
    uint16_t fileInstance;
    uint16_t localFileNamePointer;
    uint16_t networkAddressPointer;
    uint8_t fileTransferTrigger;
    uint8_t fileTransStatus;
    uint16_t gemIWTPPointer;
    uint16_t vlan;
    uint32_t fileSize;
    omci_table_attr_t directoryListingTable;
}omci_file_transfer_ctrl_t, *omci_file_transfer_ctrl_ptr;

/*******************************************************************************************************************************
9.12.14 Generic status portal (Class ID 330)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_generic_stat_portal_s{
    uint16_t 	meId;
    omci_table_attr_t statDocTable;
    omci_table_attr_t configDocTable;
    uint8_t 	avcReportRate;	
}omci_generic_stat_portal_t, *omci_generic_stat_portal_ptr;

/*******************************************************************************************************************************
9.12.15 SNMP config data (Class ID 335) 

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_snmp_cfg_data_s{
    uint16_t 	meId;
    uint16_t 	snmpVer;
    uint16_t 	snmpAgentAddr;	
    uint32_t 	snmpServerAddr;
    uint16_t 	snmpServerPort;
    uint16_t 	securityNamePointer;
    uint16_t 	communityRead;
    uint16_t 	communityWrite;
    uint16_t 	sysNamePointer;
}omci_snmp_cfg_data_t, *omci_snmp_cfg_data_ptr;

/*******************************************************************************************************************************
9.12.16 BBF TR-069 management server (Class ID 340)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_tr69_manage_srv_s{
    uint16_t meId;
    uint8_t adminState;
    uint16_t acsNetworkAddress;
    uint16_t associatedTag;
}omci_tr69_manage_srv_t, *omci_tr69_manage_srv_ptr;

/*******************************************************************************************************************************
9.12.17 threshold data 64-bit (Class ID 426)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_threshold_data_64bit_s{
    uint16_t meId;
    uint64_t thresholdValue[14];
}omci_threshold_data_64bit_t, *omci_threshold_data_64bit_ptr;

/*******************************************************************************************************************************
9.12.19 time status message (Class ID 440)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_time_status_message_s{
    uint16_t meId;
    uint8_t domainNumber;
    uint8_t flagField;
    uint16_t currentUtcOffset;
    uint8_t priority1;
    uint8_t clockClass;
    uint8_t accuracy;
    uint16_t offsetScaledLogVariance;
    uint8_t priority2;
    uint64_t grandMasterId;
    uint16_t stepsRemoved;
    uint8_t timeSource;
}omci_time_status_message_t, *omci_time_status_message_ptr;

/*9.13*/
/*******************************************************************************************************************************
9.13.11 Enhanced security control (Class ID 332)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_enhanced_security_ctrl_s{
    uint16_t meId;
    char oltCryptoCapability[16];
    omci_table_attr_t oltRandomChallengeTable;
    uint8_t oltChallengeStatus;
    uint8_t onuSelectCryptoCapability;
    omci_table_attr_t onuRandomChallengeTable;
    omci_table_attr_t onuAuthResultTable;
    omci_table_attr_t oltAuthResultTable;
    uint8_t oltResultStatus;
    uint8_t onuAuthStatus;
    char masterSessionKeyName[16];
    omci_table_attr_t broadcastKeyTable;
    uint16_t effectiveKeyLength;
}omci_enhanced_security_ctrl_t, *omci_enhanced_security_ctrl_ptr;

/*******************************************************************************************************************************
9.13.1 Physical Path Termination Pointer Video UNI(Class ID 82)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_pptp_video_uni_s{
    uint16_t meId;
    uint8_t adminState;
    uint8_t opState;
    uint8_t arc;
    uint8_t arcInterval;
    uint8_t powerCtrl;
}omci_pptp_video_uni_t, *omci_pptp_video_uni_ptr;

/*******************************************************************************************************************************
9.13.2 Physical Path Termination Pointer Video ANI(Class ID 90)

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_pptp_video_ani_s{
    uint16_t meId;
    uint8_t adminState;
    uint8_t opState;
    uint8_t arc;
    uint8_t arcInterval;
    uint8_t freqRangLow;
    uint8_t freqRangHigh;
    uint8_t signalCap;
    uint8_t opSignalLevel;
    uint8_t pilotSignalLevel;
    uint8_t signalLevelMin;
    uint8_t signalLevelMax;
    uint32_t pilotFreq;
    uint8_t agcMode;
    uint8_t agcSetting;
    uint8_t vLowerOpThreshold;
    uint8_t vUpperOpThreshold;
}omci_pptp_video_ani_t, *omci_pptp_video_ani_ptr;

/*******************************************************************************************************************************
A.2.33 Synchronize time

********************************************************************************************************************************/
typedef struct GNU_PACKED omci_synchronize_time_s{
	uint16_t year;
	uint8_t month; /*range 1..12*/
	uint8_t dayOfMonth; /*range 1..31*/
	uint8_t hourOfDay; /*range 0..23*/
	uint8_t minuteOfHour; /*range 0..59*/
	uint8_t secondOfMinute; /*range 0..59*/
}omci_synchronize_time_t, *omci_synchronize_time_ptr;


/************************************************************************
*                  F U N C T I O N    D E C L A R A T I O N S
#                  I N L I N E    F U N C T I O N   D E F I N I T I O N S
*************************************************************************
*/

/*EVENT Definitions*/
typedef enum {
	OMCI_EVENT_PHY_READY = 0,
	OMCI_EVENT_PHY_LOS,
	OMCI_EVENT_ALARM,
	OMCI_EVENT_AVC,	
	OMCI_EVENT_TCA,
	OMCI_EVENT_TEST_RESULT,
	OMCI_EVENT_ARC,
	OMCI_EVENT_AVC_REPORT_RATE,
	OMCI_EVENT_AUTO_MODE_CHANGE,
	OMCI_EVENT_MAX_ID
}omci_evt_id_t;

#define OMCI_EVENT_PHY_READY_MASK		(1 << OMCI_EVENT_PHY_READY)
#define OMCI_EVENT_PHY_LOS_MASK			(1 << OMCI_EVENT_PHY_LOS)
#define OMCI_EVENT_ALARM_MASK			(1 << OMCI_EVENT_ALARM)
#define OMCI_EVENT_AVC_MASK				(1 << OMCI_EVENT_AVC)
#define OMCI_EVENT_TCA_MASK				(1 << OMCI_EVENT_TCA)
#define OMCI_EVENT_TEST_RESULT_MASK		(1 << OMCI_EVENT_TEST_RESULT)
#define OMCI_EVENT_ARC_MASK				(1 << OMCI_EVENT_ARC)
#define OMCI_EVENT_AVC_REPORT_RATE_MASK	(1 << OMCI_EVENT_AVC_REPORT_RATE)

typedef enum {
	OMCI_ALARM_CLEAR = 1,
	OMCI_ALARM_HAPPEND,
}alarm_flag_t;

/*OMCI_EVENT_ALARM/OMCI_EVENT_TCA*/
typedef struct GNU_PACKED evt_alarm_data_s{
	uint16_t class_id;
	uint16_t inst_id;
	uint16_t alarm_num;
	alarm_flag_t alarm_flag;	
}evt_alarm_data_t, *evt_alarm_data_ptr;

/*OMCI_EVENT_AVC*/
typedef struct GNU_PACKED evt_avc_data_s{
	uint16_t class_id;
	uint16_t inst_id;
	uint16_t avc_index;
	uint8_t avc_data[128];	
}evt_avc_data_t, *evt_avc_data_ptr;

#define OMCI_BASELINE_CONT_LEN 32
/*OMCI_EVENT_TEST_RESULT*/
typedef struct GNU_PACKED evt_test_result_data_s{
	uint16_t trans_rel_id; 		//transaction correlation identifier
	uint8_t dev_id;
	uint16_t class_id;
	uint16_t inst_id;
	uint8_t  test_rest[OMCI_BASELINE_CONT_LEN];	
	uint8_t	 length;
}evt_test_result_data_t, *evt_test_result_data_ptr;

/*OMCI_EVENT_ARC*/
typedef struct GNU_PACKED evt_arc_data_s{
	uint16_t class_id;
	uint16_t inst_id;
	int arc_en;
	uint8_t interval;
}evt_arc_data_t, *evt_arc_data_ptr;

#define ARC_ENABLE		1
#define ARC_DISABLE		0

/*OMCI_EVENT_AVC_REPORT_RATE using omci_me_info_ptr*/


/*OMCI Upgrade Image*/
typedef struct GNU_PACKED softimage_s{
	char version[14];
	uint8_t committed;
	uint8_t active;
	uint8_t valid;
}softimage_t, *softimage_ptr;

typedef struct GNU_PACKED softimage_state_s{
	softimage_t image0;
	softimage_t image1;
}softimage_state_t,softimage_state_ptr;


#define DO_NOT_REPORT_OMCC_TCONT	0xFFFF
typedef struct GNU_PACKED ploam_info_s{
	uint16_t onu_id;
	uint16_t response_time;
}ploam_info_t,ploam_info_ptr;

typedef struct omci_lib_adpt_hook_s{
 	int (*omci_lib_adpt_receive_pkt_hook)(uint8_t *pkt_buff, int *pkt_len);
 	int (*omci_lib_adpt_transmit_pkt_hook)(uint8_t *pkt_buff, int pkt_len);
 	int (*omci_lib_adpt_pkt_handler_hook)(omci_me_info_ptr me_info_ptr);
 	int (*omci_lib_adpt_set_pon_start_hook)(void);
 	int (*omci_lib_adpt_get_info_after_ploam_done_hook)(ploam_info_t *info);
 	int (*omci_lib_adpt_update_pm_history_data_hook)();
 	int (*omci_lib_adpt_set_event_monitor_hook)(uint32_t event_id_mask);
 	int (*omci_lib_adpt_get_softimage_version_hook)(char *version,uint8_t ver_len, uint8_t image_flag);
 	int (*omci_lib_adpt_get_bootflag_hook)(uint8_t* bootflag);
 	int (*omci_lib_adpt_set_bootflag_hook)(uint8_t bootflag);
 	int (*omci_lib_adpt_save_softimage_state_hook)(softimage_state_t *image_state);
 	int (*omci_lib_adpt_read_softimage_state_hook)(softimage_state_t *image_state);
 	int (*omci_lib_adpt_get_current_image_version_hook)(char *version,uint8_t ver_len, char *image_path);
 	int (*omci_lib_adpt_is_current_image_valid_hook)(char *image_path,uint32_t olt_crc_val);
 	int (*omci_lib_adpt_write_image_hook)(uint8_t image_flag, char*image_path);
 	int (*omci_lib_adpt_enhanced_security_ctrl_set_msk_hook)(uint8_t *msk, uint8_t msk_len);
	int (*omci_lib_adpt_get_random_data_hook)(uint8_t *random_val);
	int (*omci_lib_adpt_table_mem_free_hook)(omci_me_info_ptr me_info_ptr);
	int (*omci_lib_adpt_screen_print_hook)(char *content);
	void (*omci_lib_adpt_stop_timer_hook)(void);
	int (*omci_attr_get_all_data_except_table_attr_hook)(omci_me_info_ptr me_info);
}omci_lib_adpt_hook_t, *omci_lib_adpt_hook_ptr;

int omci_lib_adpt_init_func_hook(omci_lib_adpt_hook_t **adpt_hook_pptr);
int omci_lib_adpt_denit_func_hook(void);


extern int omci_lib_get_attr_by_mask(omci_me_info_ptr me_info_ptr);
extern int omci_lib_get_inst_count_by_classid(uint16_t class_id, int* inst_count);
extern int omci_lib_get_inst_list_by_classid(uint16_t class_id, uint16_t *inst_list, int list_len);



extern int omci_lib_send_event(omci_evt_id_t event_id, void *event_val);



#endif /* _OMCI_ME_EXTERNAL_H_ */

